/*
 * @lc app=leetcode.cn id=2194 lang=typescript
 *
 * [2194] Excel 表中某个范围内的单元格
 */

// @lc code=start
function cellsInRange(s: string): string[] {
    const [a, b] = s.split(":");
    const col = [a.charCodeAt(0), b.charCodeAt(0)];
    const row = [parseInt(a[1]), parseInt(b[1])];

    let res: string[] = [];
    for (let i = col[0]; i <= col[1]; i++) {
        for (let j = row[0]; j <= row[1]; j++) {
            res.push(String.fromCharCode(i) + j);
        }
    }
    return res;
}
// @lc code=end
